import {request, config} from 'utils'
import axios from 'axios'
import FileSaver from 'file-saver'

const {api} = config
const {shop,payOrder,salesPaymenter,pay,distributor} = api

//查询订单信息
export async function query(queryParam) {
  const url = `${shop}/cart/settlement`
  return request({url: url, method: 'post', data: queryParam})
}
export async function create(queryParam) {
  const url = `${payOrder}/create`
  return request({url: url, method: 'post', data: queryParam})
}
export async function mine() {
  const url = `${salesPaymenter}/distributor/mine`
  return request({url: url, method: 'get', data: {}})
}
export async function onlineRecharge(queryParam) {
  const url = `${pay}/getRechargeReceiptPath`
  return request({url: url, method: 'put', data: queryParam})
}
export async function accountRecharge(queryParam) {
  const url = `${payOrder}/balance/pay`
  return request({url: url, method: 'post', data: queryParam})
}
export async function accountBalance({id}) {
  const url = `${distributor}/${id}/search`
  return request({url: url, method: 'post', data: {}})
}